#ifndef QOBJECTPROPERTY_H
#define QOBJECTPROPERTY_H

#include <QObject>
#include <QMap>
#include <QVariant>
#include <QStringList>
#include <QList>

class QProperty;
class QObjectManager;

class QObjectProperty : public QObject
{
    Q_OBJECT
public:
    explicit QObjectProperty(QObjectManager *manager,QObject *object,QObject *parent = 0);

    QStringList groups();

    QProperty*  getProperty(const QString &name);

    QList<QProperty*>   propertys();

    QObject *object();

    void    updateDefaultValue();
signals:
    void changed(QProperty* pro);
    void updatePropertyAttribute();
public slots:
    void propertyChanged();
protected:
    QProperty   *createProperty(const QString &name,const QString &className);
protected:
    QList<QProperty*>        m_propertys;
    QMap<QString,QProperty*> m_nameToPropertys;
    QStringList              m_groups;
    QObjectManager          *m_manager;
    QObject                 *m_object;
};

#endif // QOBJECTPROPERTY_H
